/summon villager ~ ~2 ~ {VillagerData:{profession:librarian,level:5,type:plains},Offers:{Recipes:[
{buy:{id:music_disc_ward,Count:1,tag:
{display:{Name:"{\"text\":\"Nearly Perfect Talisman\",\"color\":\"yellow\"}"},AttributeModifiers:
[{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.02,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:1,Operation:1,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.armorToughness",Name:"generic.armorToughness",Amount:14,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:14,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"}]}}

,buyB:{id:dragon_egg,Count:2}

,sell:{id:music_disc_11,Count:1,tag:
{display:{Name:"{\"text\":\"Perfect Talisman\",\"color\":\"gold\"}"},AttributeModifiers:
[{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:0.04,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:8,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:1,Operation:1,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.armorToughness",Name:"generic.armorToughness",Amount:18,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"},
{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:20,Operation:0,UUIDLeast:1,UUIDMost:1,Slot:"offhand"}]}}
,maxUses:9999999}]}}